<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.sql.*" %>

<%

String dbType = "MySql";		//MySql || Oracle

String userName="admin";

String userPasswd="fabian";

String dbName="";
 
String url="jdbc:oracle:thin:@localhost:1521:orcl";

//String url="jdbc:mysql://localhost:3306/databasename";

Connection conn = null;

try{
	try{

		Class.forName("oracle.jdbc.driver.OracleDriver");
		//Class.forName("com.mysql.jdbc.Driver");
    	conn =DriverManager.getConnection(url,userName,userPasswd);

	}catch (ClassNotFoundException ex) {
    	out.println("加载" + dbType + "驱动器失败："+ex.getMessage());
		out.println("栈跟踪信息：");
		ex.printStackTrace();
	}catch (SQLException ex) {
		out.println("数据库建立连接失败："+ex.getMessage());
		out.println("栈跟踪信息：");
		ex.printStackTrace();
	}
	
	System.out.println("create conn success!");
	
%>